package com.xm.service.framework.feign;


import com.fasterxml.jackson.databind.JsonNode;
import com.xm.service.framework.feign.fallback.BookFeignClientFallback;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;


import xm.common.book.entity.Book;
import java.util.List;
import java.util.Map;

@FeignClient(name = "book-service" ,fallback = BookFeignClientFallback.class)
public interface BookFeignClient {
    @GetMapping(value = "/book/list")
    List<Book> list();

    @PostMapping(value = "/book/add")
    String add(@RequestParam String author, @RequestParam int stock,
               @RequestParam String name, @RequestParam String date);

    @PutMapping("book/update")
     String updateStockByid(@RequestParam int id,@RequestParam int stock);


    @DeleteMapping("book/delete")
     String deleteById(@RequestParam int id);


}

